package com.aiti.lulian.mapper.card;

import com.aiti.base.core.base.mapper.SuperMapper;
import com.aiti.lulian.dto.EnterpriseDto;
import com.aiti.lulian.entity.LuLianEnterpriseUser;
import com.aiti.lulian.entity.crad.LuLianEnterpriseOperation;
import com.aiti.lulian.vo.EnterpriseOpenCardInfo;
import com.aiti.lulian.vo.LuLianEnterpriseOperationVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface LuLianEnterpriseOperationMapper extends SuperMapper<LuLianEnterpriseOperation> {

    LuLianEnterpriseOperationVo selectEnterpriseOperationDetails(@Param("enterpriseId") String enterpriseId);

    Map<String, Object> selectData();

    LuLianEnterpriseOperationVo selectPubAndViewCount();

    // 每日新增企业
    Integer selectNewAddEnterpriseCount(@Param("startTime")String startTime, @Param("endTime")String endTime);

    // 企业开通用户总数
    Integer selectEnterpriseUserCount();

    Integer updateEnterpriseMiniVersion(@Param("enterpriseId")String enterpriseId, @Param("miniProgramVersion")Integer miniProgramVersion);

    Integer updateEnterpriseExpirationTime(@Param("enterpriseId")String enterpriseId, @Param("expirationTime")String expirationTime);

    Integer selectUserEnterpriseManagerRoleCount(@Param("userId")String userId);

    void insertEnterpriseManageRole(@Param("uuid")String uuid, @Param("userId")String userId);

    String queryCompanyIdByUserId(@Param("userId")String userId);

    void updateCompanyIdByUserId(@Param("companyId")String companyId, @Param("userId")String userId);

    List<LuLianEnterpriseUser> selectEnterpriseUserList(@Param("enterpriseId")String enterpriseId);

    // 企业新开通的用户数（昨天）
    Integer selectEnterpriseUserCountNew(@Param("startTime")String startTime, @Param("endTime")String endTime);
}